package com.yn.xgame.logic.player;

import java.util.UUID;

import com.yn.xgame.pb.GateClientProto;

public class UserMessage {// 用户信息
	private String msg_id;
	private int user_id;
	private String msg_isread;
	private String msg_title;
	private String msg_desc;
	
	public String getMsg_id() {
		return msg_id;
	}

	public UserMessage(String msg_id, int user_id, String msg_isread, String msg_title, String msg_desc) {
		super();
		this.msg_id = msg_id;
		this.user_id = user_id;
		this.msg_isread = msg_isread;
		this.msg_title = msg_title;
		this.msg_desc = msg_desc;
	}

	public void setMsg_id(String msg_id) {
		this.msg_id = msg_id;
	}

	public int getUser_id() {
		return user_id;
	}

	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}

	public String getMsg_isread() {
		return msg_isread;
	}

	public void setMsg_isread(String msg_isread) {
		this.msg_isread = msg_isread;
	}

	public String getMsg_title() {
		return msg_title;
	}

	public void setMsg_title(String msg_title) {
		this.msg_title = msg_title;
	}

	public String getMsg_desc() {
		return msg_desc;
	}

	public void setMsg_desc(String msg_desc) {
		this.msg_desc = msg_desc;
	}

	public UserMessage() {
		msg_id=UUID.randomUUID().toString().replaceAll("-", "");
	}
	public boolean isDelete(){
		return msg_isread != "-1";
	}
	public GateClientProto.UserMsgResp.Msg build() {
		return GateClientProto.UserMsgResp.Msg.newBuilder().setMsgId(msg_id).setMsgTitle(msg_title)
				.setMsgIsread(msg_isread)
				.setMsgDesc(msg_desc)
				.build();
	}
}
